/***********************************************************************
	filename: 	DaterRecEvent.h
	created:	22/4/2012
	author:		4Ys
	
	purpose:	Defines classes to recover orders from server to client,
				specifically for event.	            
*************************************************************************/
#ifndef _DaterRecEvent_h_
#define _DaterRecEvent_h_

#include "DaterRecover.h"
#include "DaterEvent.h"
#include "DaterTime.h"


namespace Dater
{
	class RecEvent : public Recover
	{
	public:
		/*!
		 \brief
			 Construct class RecEvent with a param.

		 \param splitedVector
		     - a vector of string of orders from server to client to describe the event.
		*/
		RecEvent(std::string recvMessage): Recover(recvMessage) {}
		
		/*!
		 \brief
			 A pure virtual function generates from class Recover, specifically for event.

		 \return
			 a string of order, especially for event.
		*/
		//virtual bool execute() = 0;
	};

	class RecEventAdd : public RecEvent
	{
	public:
		/*!
		 \brief
			 Construct class RecEventAdd with a param.
			 
		 \param splitedVector
		     - a vector of string of orders from server to client to describe the result of adding event.
		*/
		RecEventAdd(std::string recvMessage): RecEvent(recvMessage) {}
		
		/*!
		 \brief
			 A virtual function generates from class RecEvent, 
			 check whether add event successfully.

		 \return
			 true - add event successfully
			 false - add event fail
		*/
		bool execute();
	};
	
	class RecEventUpdate : public RecEvent
	{
	public:
		/*!
		 \brief
			 Construct class RecEventUpdate with a param.
			 
		 \param splitedVector
		     - a vector of string of orders from server to client to describe the result of updating event.
		*/
		RecEventUpdate(std::string recvMessage): RecEvent(recvMessage) {}
		
		/*!
		 \brief
			 A virtual function generates from class RecEvent, 
			 check whether update event successfully.

		 \return
			 true - update event successfully
			 false - update event fail
		*/
		bool execute();

	};

	class RecEventDelete : public RecEvent
	{
	public:
		/*!
		 \brief
			 Construct class RecEventDelete with a param.
			 
		 \param splitedVector
		     - a vector of string of orders from server to client to describe the result of deleting event.
		*/
		RecEventDelete(std::string recvMessage): RecEvent(recvMessage) {}
		
		/*!
		 \brief
			 A virtual function generates from class RecEvent, 
			 check whether delete event successfully.

		 \return
			 true - delete event successfully
			 false - delete event fail
		*/
		bool execute();

	};

	class RecEventView : public RecEvent
	{
	public:
		/*!
		 \brief
			 Construct class RecEventView with a param.
			 
		 \param splitedVector
		     - a vector of string of orders from server to client to describe the event.
		*/
		RecEventView(std::string recvMessage): RecEvent(recvMessage) {}
		
		/*!
		 \brief
			 A virtual function generates from class RecEvent, 
			 to recover event by orders in vector "splitedVector".

		 \return
			 true - view event successfully
			 false - view event fail
		*/
		Event* execute();
				
		/* !
		\brief
			get the Events of an order by server

		\return
			a pointer point to an evemt class Event object
		*/
		//std::vector<Event*> getEvent();

	private:
		/*!
		 a vector of strings - every attribute information of events splited from sqlData.
		*/
		//std::vector<std::string> _dataVector;
		
		/*!
		 a vector of Events recovered from _dataVector.
		*/		
		//std::vector<Event*> _resultEvent;
	};
}
#endif